package com.sec.datasource.datasource.config;

import com.sec.datasource.datasource.config.enums.DataSourceEnum;

public class DataSourceContextHolder {

    private static final ThreadLocal<String> contextHolder = new InheritableThreadLocal<>();

    public static void setDataSource(DataSourceEnum db){
        contextHolder.set(db.getValue());
    }

    public static String getDataSource(){
        return contextHolder.get();
    }

    public static void clear(){
        contextHolder.remove();
    }

}
